#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,m,k,x,T;
signed main()
{
	freopen("arena.in","r",stdin),freopen("arena.out","w",stdout);
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		cin>>n;
	k=4;
	for(int i=1;i<=m;i++)
		cin>>m;
	for(int i=1;i<=4*k-1;i++)
		cin>>k;
	cin>>T;
	while(T--)
		cout<<0<<'\n';
}
